home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / OpenGL / glmap2.z / glmap2
Encoding:
Text File  |  2001-04-17  |  22.0 KB  |  361 lines

  1.  
  2.  
  3.  
  4. ggggllllMMMMaaaapppp2222((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp2222((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllMMMMaaaapppp2222dddd,,,, ggggllllMMMMaaaapppp2222ffff - define a two-dimensional evaluator
  10.  
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      void ggggllllMMMMaaaapppp2222dddd( GLenum _t_a_r_g_e_t,
  14.                    GLdouble _u_1,
  15.                    GLdouble _u_2,
  16.                    GLint _u_s_t_r_i_d_e,
  17.                    GLint _u_o_r_d_e_r,
  18.                    GLdouble _v_1,
  19.                    GLdouble _v_2,
  20.                    GLint _v_s_t_r_i_d_e,
  21.                    GLint _v_o_r_d_e_r,
  22.                    const GLdouble *_p_o_i_n_t_s )
  23.      void ggggllllMMMMaaaapppp2222ffff( GLenum _t_a_r_g_e_t,
  24.                    GLfloat _u_1,
  25.                    GLfloat _u_2,
  26.                    GLint _u_s_t_r_i_d_e,
  27.                    GLint _u_o_r_d_e_r,
  28.                    GLfloat _v_1,
  29.                    GLfloat _v_2,
  30.                    GLint _v_s_t_r_i_d_e,
  31.                    GLint _v_o_r_d_e_r,
  32.                    const GLfloat *_p_o_i_n_t_s )
  33.  
  34.  
  35. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  36.      _t_a_r_g_e_t   Specifies the kind of values that are generated by the
  37.               evaluator.  Symbolic constants GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333,
  38.               GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444, GGGGLLLL____MMMMAAAAPPPP2222____IIIINNNNDDDDEEEEXXXX, GGGGLLLL____MMMMAAAAPPPP2222____CCCCOOOOLLLLOOOORRRR____4444,
  39.               GGGGLLLL____MMMMAAAAPPPP2222____NNNNOOOORRRRMMMMAAAALLLL, GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111,
  40.               GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222, GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333, and
  41.               GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444 are accepted.
  42.  
  43.      _u_1, _u_2   Specify a linear mapping of u, as presented to ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd2222, to
  44.               u^, one of the two variables that are evaluated by the equations
  45.               specified by this command. Initially, _u_1 is 0 and _u_2 is 1.
  46.  
  47.      _u_s_t_r_i_d_e  Specifies the number of floats or doubles between the beginning
  48.               of control point R   and the beginning of control point R      ,
  49.                                 ij                                     (i+1)j
  50.               where i and j are the u and v control point indices,
  51.               respectively.  This allows control points to be embedded in
  52.               arbitrary data structures.  The only constraint is that the
  53.               values for a particular control point must occupy contiguous
  54.               memory locations. The initial value of _u_s_t_r_i_d_e is 0.
  55.  
  56.      _u_o_r_d_e_r   Specifies the dimension of the control point array in the u
  57.               axis.  Must be positive. The initial value is 1.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                                                         PPPPaaaaggggeeee 1111
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71. ggggllllMMMMaaaapppp2222((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp2222((((3333GGGG))))
  72.  
  73.  
  74.  
  75.      _v_1, _v_2   Specify a linear mapping of v, as presented to ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd2222, to
  76.               v^, one of the two variables that are evaluated by the equations
  77.               specified by this command. Initially, _v_1 is 0 and _v_2 is 1.
  78.  
  79.      _v_s_t_r_i_d_e  Specifies the number of floats or doubles between the beginning
  80.               of control point R   and the beginning of control point R      ,
  81.                                 ij                                     i(j+1)
  82.               where i and j are the u and v control point indices,
  83.               respectively.  This allows control points to be embedded in
  84.               arbitrary data structures.  The only constraint is that the
  85.               values for a particular control point must occupy contiguous
  86.               memory locations. The initial value of _v_s_t_r_i_d_e is 0.
  87.  
  88.      _v_o_r_d_e_r   Specifies the dimension of the control point array in the v
  89.               axis.  Must be positive. The initial value is 1.
  90.  
  91.      _p_o_i_n_t_s   Specifies a pointer to the array of control points.
  92.  
  93. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  94.      Evaluators provide a way to use polynomial or rational polynomial mapping
  95.      to produce vertices, normals, texture coordinates, and colors.  The
  96.      values produced by an evaluator are sent on to further stages of GL
  97.      processing just as if they had been presented using ggggllllVVVVeeeerrrrtttteeeexxxx, ggggllllNNNNoooorrrrmmmmaaaallll,
  98.      ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, and ggggllllCCCCoooolllloooorrrr commands, except that the generated values do not
  99.      update the current normal, texture coordinates, or color.
  100.  
  101.      All polynomial or rational polynomial splines of any degree (up to the
  102.      maximum degree supported by the GL implementation) can be described using
  103.      evaluators.  These include almost all surfaces used in computer graphics,
  104.      including B-spline surfaces, NURBS surfaces, Bezier surfaces, and so on.
  105.  
  106.      Evaluators define surfaces based on bivariate Bernstein polynomials.
  107.      Define p(u^,v^) as
  108.  
  109.                                               m     n      m
  110.                                       n           B (u^) B (v^) R
  111.                       p(u^,v^)  =               R    i     j     ij
  112.                                       R
  113.                                          j = 0
  114.                                  i = 0
  115.  
  116.  
  117.  
  118.                                      n
  119.      where R   is a control point, B (u^) is the ith Bernstein polynomial of
  120.             ij                      i
  121.      degree
  122.      n (_u_o_r_d_e_r = n + 1)
  123.  
  124.                                        (   )
  125.                                n          n   i     n-i
  126.                              B (u^)  =  |   | u^ (1-u^)
  127.                               i
  128.                                        (i )
  129.  
  130.  
  131.            m
  132.      and B (v^) is the jth Bernstein polynomial of degree m (_v_o_r_d_e_r = m + 1)
  133.           j
  134.  
  135.                                        (   )
  136.                                m          m   j     m-j
  137.                              B (v^)  =  |   | v^ (1-v^)
  138.                               j
  139.                                        (j )
  140.  
  141.  
  142.      Recall that
  143.                                           (   )
  144.                                 0           n
  145.                                0  _= 1 and |   |   _=  1
  146.  
  147.                                           (0 )
  148.  
  149.  
  150.  
  151.  
  152.                                                                         PPPPaaaaggggeeee 2222
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. ggggllllMMMMaaaapppp2222((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp2222((((3333GGGG))))
  160.  
  161.  
  162.  
  163.      ggggllllMMMMaaaapppp2222 is used to define the basis and to specify what kind of values are
  164.      produced.  Once defined, a map can be enabled and disabled by calling
  165.      ggggllllEEEEnnnnaaaabbbblllleeee and ggggllllDDDDiiiissssaaaabbbblllleeee with the map name, one of the nine predefined
  166.      values for _t_a_r_g_e_t, described below.  When ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd2222 presents values u
  167.      and v, the bivariate Bernstein polynomials are evaluated using u^ and v^,
  168.      where
  169.  
  170.                                                 u - u1_______
  171.                                    u^  =
  172.                                          u2 - u1
  173.  
  174.                                                 v - v1_______
  175.                                    v^  =
  176.                                          v2 - v1
  177.  
  178.  
  179.      _t_a_r_g_e_t is a symbolic constant that indicates what kind of control points
  180.      are provided in _p_o_i_n_t_s, and what output is generated when the map is
  181.      evaluated.  It can assume one of nine predefined values:
  182.  
  183.      GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333         Each control point is three floating-point
  184.                               values representing x, y, and z.  Internal
  185.                               ggggllllVVVVeeeerrrrtttteeeexxxx3333 commands are generated when the map is
  186.                               evaluated.
  187.  
  188.      GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444         Each control point is four floating-point values
  189.                               representing x, y, z, and w.  Internal ggggllllVVVVeeeerrrrtttteeeexxxx4444
  190.                               commands are generated when the map is
  191.                               evaluated.
  192.  
  193.      GGGGLLLL____MMMMAAAAPPPP2222____IIIINNNNDDDDEEEEXXXX            Each control point is a single floating-point
  194.                               value representing a color index.  Internal
  195.                               ggggllllIIIInnnnddddeeeexxxx commands are generated when the map is
  196.                               evaluated but the current index is not updated
  197.                               with the value of these ggggllllIIIInnnnddddeeeexxxx commands.
  198.  
  199.      GGGGLLLL____MMMMAAAAPPPP2222____CCCCOOOOLLLLOOOORRRR____4444          Each control point is four floating-point values
  200.                               representing red, green, blue, and alpha.
  201.                               Internal ggggllllCCCCoooolllloooorrrr4444 commands are generated when
  202.                               the map is evaluated but the current color is
  203.                               not updated with the value of these ggggllllCCCCoooolllloooorrrr4444
  204.                               commands.
  205.  
  206.      GGGGLLLL____MMMMAAAAPPPP2222____NNNNOOOORRRRMMMMAAAALLLL           Each control point is three floating-point
  207.                               values representing the x, y, and z components
  208.                               of a normal vector.  Internal ggggllllNNNNoooorrrrmmmmaaaallll commands
  209.                               are generated when the map is evaluated but the
  210.                               current normal is not updated with the value of
  211.                               these ggggllllNNNNoooorrrrmmmmaaaallll commands.
  212.  
  213.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111  Each control point is a single floating-point
  214.                               value representing the s texture coordinate.
  215.                               Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd1111 commands are generated when
  216.                               the map is evaluated but the current texture
  217.                               coordinates are not updated with the value of
  218.                               these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  219.  
  220.  
  221.  
  222.  
  223.                                                                         PPPPaaaaggggeeee 3333
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230. ggggllllMMMMaaaapppp2222((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp2222((((3333GGGG))))
  231.  
  232.  
  233.  
  234.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222  Each control point is two floating-point values
  235.                               representing the s and t texture coordinates.
  236.                               Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd2222 commands are generated when
  237.                               the map is evaluated but the current texture
  238.                               coordinates are not updated with the value of
  239.                               these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  240.  
  241.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333  Each control point is three floating-point
  242.                               values representing the s, t, and r texture
  243.                               coordinates.  Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd3333 commands are
  244.                               generated when the map is evaluated but the
  245.                               current texture coordinates are not updated with
  246.                               the value of these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  247.  
  248.      GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444  Each control point is four floating-point values
  249.                               representing the s, t, r, and q texture
  250.                               coordinates.  Internal ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd4444 commands are
  251.                               generated when the map is evaluated but the
  252.                               current texture coordinates are not updated with
  253.                               the value of these ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd commands.
  254.  
  255.      _u_s_t_r_i_d_e, _u_o_r_d_e_r, _v_s_t_r_i_d_e, _v_o_r_d_e_r, and _p_o_i_n_t_s define the array addressing
  256.      for accessing the control points.  _p_o_i_n_t_s is the location of the first
  257.      control point, which occupies one, two, three, or four contiguous memory
  258.      locations, depending on which map is being defined.  There are
  259.      uorder x vorder control points in the array.  _u_s_t_r_i_d_e specifies how many
  260.      float or double locations are skipped to advance the internal memory
  261.      pointer from control point R   to control point R      .  _v_s_t_r_i_d_e
  262.                                  ij                   (i+1)j
  263.      specifies how many float or double locations are skipped to advance the
  264.      internal memory pointer from control point R   to control point R      .
  265.                                                  ij                   i(j+1)
  266.  
  267. NNNNOOOOTTTTEEEESSSS
  268.      As is the case with all GL commands that accept pointers to data, it is
  269.      as if the contents of _p_o_i_n_t_s were copied by ggggllllMMMMaaaapppp2222 before ggggllllMMMMaaaapppp2222 returns.
  270.      Changes to the contents of _p_o_i_n_t_s have no effect after ggggllllMMMMaaaapppp2222 is called.
  271.  
  272.      Initially, GGGGLLLL____AAAAUUUUTTTTOOOO____NNNNOOOORRRRMMMMAAAALLLL is enabled. If GGGGLLLL____AAAAUUUUTTTTOOOO____NNNNOOOORRRRMMMMAAAALLLL is enabled,
  273.      normal vectors are generated when either GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333 or
  274.      GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444 is used to generate vertices.
  275.  
  276. EEEERRRRRRRROOOORRRRSSSS
  277.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _t_a_r_g_e_t is not an accepted value.
  278.  
  279.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _u_1 is equal to _u_2, or if _v_1 is equal to
  280.      _v_2.
  281.  
  282.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if either _u_s_t_r_i_d_e or _v_s_t_r_i_d_e is less than
  283.      the number of values in a control point.
  284.  
  285.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if either _u_o_r_d_e_r or _v_o_r_d_e_r is less than 1
  286.      or greater than the return value of GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR.
  287.  
  288.  
  289.  
  290.  
  291.                                                                         PPPPaaaaggggeeee 4444
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298. ggggllllMMMMaaaapppp2222((((3333GGGG))))                     OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                     ggggllllMMMMaaaapppp2222((((3333GGGG))))
  299.  
  300.  
  301.  
  302.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllMMMMaaaapppp2222 is executed between the
  303.      execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd.
  304.  
  305. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  306.      ggggllllGGGGeeeettttMMMMaaaapppp
  307.      ggggllllGGGGeeeetttt with argument GGGGLLLL____MMMMAAAAXXXX____EEEEVVVVAAAALLLL____OOOORRRRDDDDEEEERRRR
  308.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____3333
  309.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____VVVVEEEERRRRTTTTEEEEXXXX____4444
  310.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____IIIINNNNDDDDEEEEXXXX
  311.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____CCCCOOOOLLLLOOOORRRR____4444
  312.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____NNNNOOOORRRRMMMMAAAALLLL
  313.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____1111
  314.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____2222
  315.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____3333
  316.      ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____MMMMAAAAPPPP2222____TTTTEEEEXXXXTTTTUUUURRRREEEE____CCCCOOOOOOOORRRRDDDD____4444
  317.  
  318.  
  319. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  320.      ggggllllBBBBeeeeggggiiiinnnn, ggggllllCCCCoooolllloooorrrr, ggggllllEEEEnnnnaaaabbbblllleeee, ggggllllEEEEvvvvaaaallllCCCCoooooooorrrrdddd, ggggllllEEEEvvvvaaaallllMMMMeeeesssshhhh, ggggllllEEEEvvvvaaaallllPPPPooooiiiinnnntttt, ggggllllMMMMaaaapppp1111,
  321.      ggggllllMMMMaaaappppGGGGrrrriiiidddd, ggggllllNNNNoooorrrrmmmmaaaallll, ggggllllTTTTeeeexxxxCCCCoooooooorrrrdddd, ggggllllVVVVeeeerrrrtttteeeexxxx
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.                                                                         PPPPaaaaggggeeee 5555
  358.  
  359.  
  360.  
  361.